package org.mspring.mlog.web.module.stat.get;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.mspring.mlog.core.ServiceFactory;
import org.mspring.mlog.service.NewsExtService;
import org.mspring.platform.utils.RequestUtils;

/**
 * 获取新闻浏览量
 * 
 * @author Gao Youbo
 * @since 2013年7月10日
 */
public class GetNewsViewsCmd extends AbstractGetStatCmd {

    @Override
    public Object get(HttpServletRequest request, HttpServletResponse response) {
        // TODO Auto-generated method stub
        Long newsId = RequestUtils.getRequestParameterAsLong(request, "id");
        if (newsId == null) {
            return null;
        }
        return ServiceFactory.getBean(NewsExtService.class).getCachedViews(newsId);
    }

}
